
include Bzflag

# parameter

range = 20

# Airspawn class

class Airspawn < Plugin

	def initialize(range = 0)

		@range = range

		if @range < 0.001
			@range = 10.0	
		end

	end

	def get_player_spawn_pos(spawn)
		
		tmp = spawn.pos 
		tmp[2] = @range
		spawn.pos = tmp
		spawn.handled = true

	end

end

# new Airspawn instance
airspawn = Airspawn.new(range)

# register airspawn plugin
airspawn.register
